package domain.worm;

import images.Images;

import java.awt.Color;

import com.uqbar.vainilla.DeltaState;
import com.uqbar.vainilla.appearances.Appearance;
import com.uqbar.vainilla.appearances.Circle;

public class StateFalling extends WormState {

	public StateFalling(Worm worm) {
		super(worm);
	}

	@Override
	public void update(DeltaState deltaState) {
		if(!this.getWorm().fall(deltaState)){
			this.getWorm().setState(new StandbyState(this.getWorm()));
		}else{
			this.getWorm().setAppearance(this.getFallAnimation());
		}
	}

	private Appearance getFallAnimation() {
		return Images.getAnimation("falling", 0.07);
	}

	
}
